package com.fire.controller;


import com.fire.response.ResultData;
import com.fire.service.ILocationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-04-04
 */
@Slf4j
@Validated
@CrossOrigin
@RestController
@RequiredArgsConstructor
@Api(tags = {"监测管理模块"})
@RequestMapping("/location")
public class LocationController {

    private final ILocationService locationService;

    /**
     * 查询城市名称
     * @return
     */
    @GetMapping("/query")
    @ApiOperation(value = "查询城市名称")
    public ResultData queryCity(){
        List<String> cities = locationService.queryCity();
        return ResultData.success(cities);
    }
}
